
        <div class="col-md-2">
            <div class="col-md-12 mini-bot-pad">
                <a href="<?php echo Yii::app()->createUrl('/perusahaan/category', array('id' => 1))?>">
                    <img src="<?php echo Yii::app()->theme->baseUrl; ?>/assets/images/pmb.png" class="img-responsive">
                </a>
            </div>
            <div class="col-md-12 mini-bot-pad">
                <a href="<?php echo Yii::app()->createUrl('/perusahaan/category', array('id' => 2))?>">
                    <img src="<?php echo Yii::app()->theme->baseUrl; ?>/assets/images/pgb.png" class="img-responsive">
                </a>
            </div>
            <div class="col-md-12 mini-bot-pad">
                <a href="<?php echo Yii::app()->createUrl('/perusahaan/category', array('id' => 3))?>">
                    <img src="<?php echo Yii::app()->theme->baseUrl; ?>/assets/images/pho.png" class="img-responsive">
                </a>
            </div>
        </div>
        <div class="col-md-10">  
                <div class="map-container">
                    <div id="map" style="min-height:450px;height:100%;"></div>
                </div> 
        </div>

<?php
$marker = '';
if ($data && !empty($data)) {
    foreach ($data as $v) {
        $rand = md5(mt_srand());
        $koord = explode(',', $v->provinsi->koordinat);
        $icon = 'icon_3';
        $content = ""
                . "<div class='panel panel-default'>"
                . "<div class='panel-heading'><h3 class='panel-title'>Provinsi " . $v->provinsi->nama . "</h3></div>"
                . "<div class='panel-body'><br/><a href='".Yii::app()->createUrl('/perusahaan/read', array('id'=>$v->perusahaan_id))."'>Lihat Rincian</a></p></div></div>";
        $marker .= "var $rand = L.marker([" . $koord[0] . ", " . $koord[1] . "], {icon: $icon}).addTo(map);\n";
        $marker .= $rand . ".bindPopup(\"$content\");\n";
    }
    $map_code = "
function getColor(e) {
    var d = e.toString().substr(0, 1);
    return '#696B97';
//    return d == 1 ? '#800026' :
//           d == 2  ? '#BD0026' :
//           d == 3  ? '#E31A1C' :
//           d == 4  ? '#FC4E2A' :
//           d == 5   ? '#FD8D3C' :
//           d == 6   ? '#FEB24C' :
//           d == 7   ? '#FECC12' :
//           d == 8   ? '#FED976' :
//                      '#FFEDA0';
}
window.onload = function () {
        var map = L.map('map', {
            center: [-2.5920, 118.42654],
            zoom: 4.8,
            zoomControl: true
        });
		//var icon_0 = L.icon({iconUrl: '/files/icon/marker_not_set.png',iconSize:[21,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]});
		var icon_1 = L.icon({iconUrl: './../files/icon/marker_complete.png',iconSize:[21,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]});
		var icon_2 = L.icon({iconUrl: './../files/icon/marker_on_schedule.png',iconSize:[21,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]});
		var icon_3 = L.icon({iconUrl: './../files/icon/marker_behind_schedule.png',iconSize:[21,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]});
		//var icon_4 = L.icon({iconUrl: './files/icon/marker_not_yet.png',iconSize:[21,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]});
        //map.dragging.disable();
        map.touchZoom.disable();
        map.doubleClickZoom.disable();
        map.scrollWheelZoom.disable();
        if (map.tap) map.tap.disable();        
        function highlightFeature(e) {
            var layer = e.target;
            var feature = layer.feature.properties;
            if (feature && feature.PROPINSI_) {
                layer.bindPopup('Provinsi: '+feature.PROPINSI_+'<br><br>'+e.latlng).openPopup();
            }
        }
        function onEachFeature(feature, layer) {
            layer.on({
                click: highlightFeature
            });            
        }        
        function style(feature) {
            return {
                fillColor: getColor(feature.properties.KODE),
                weight: 2,
                opacity: 1,
                color: 'white',
                dashArray: '3',
                fillOpacity: 0.7
            };
        }
	var countryStyle = {
		'color': '#000',
		'weight': 2,
		'opacity': 0.6
	};
" . $marker . "
	L.geoJson(Indo, {
		style: style,
                onEachFeature: onEachFeature
	}).addTo(map);
};
";
    Yii::app()->clientScript->registerScript('leaflet', $map_code);
}
?>
